<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
	
	
	
	
	
	/**
	 * 
	 * Calendar
	 * 
	 * Controller to set up all the calendars in the sistem
	 */
	class Calendar extends CI_Controller {
		
		
		
		
		
		/**
		 * __construct
		 */
		public function __construct () {
			parent::__construct();
		}
		// end: __construct
		
		
		
		
		
		/**
		 * 
		 * events
		 * 
		 * method to manage all the events in the calendar, this is the 
		 */
		public function events () {
			$this->load->view('calendar/calendar-index');
		}
		// end: events
		
		
		
		
		
		/**
		 * 
		 * event
		 * 
		 * method to show the events in one day
		 */
		 public function event($e_yeah = 0000, $e_month = 00) {
		 	// if user is logged in
			if ( $this->common->is_logged_in() ) {
				
				// loading the top of the view
				$this->load->view('templates/template-web-top');
				
				$event_data = array(
					
				);
				
				// beg: switching between user type demo
				switch ( $this->session->userdata('cisco_session_usertype') ) {
					
					// beg: user-root
					case 'root':
						$this->load->view('calendar/root/calendar-index', $event_data);	
						break;
					// end: user-root
					
					// beg: user-stats
					case 'stats':
						$this->load->view('calendar/stats/calendar-index', $event_data);
						break;
					// end: user-stats
					
					// beg: user-user
					case 'user':
					default:
						$this->load->view('calendar/user/calendar-index', $event_data);
					// end: user-user
				}
				// end: switching between user type demo
				
				// loading the bottom of the view
				$this->load->view('templates/template-web-bottom');
			}
			
			// if user is not logged in
			else
				redirect('sessions/login/?redirect_to=' . urlencode(current_url()) . '', 'location');
		 }
		// end: event
	}
	// end: Calendar